package com.homedo.microservice.wechat.personal.secretary.listener.deal;

import com.homedo.microservice.wechat.personal.secretary.cache.PersonalBotCache;
import io.github.biezhi.wechat.api.event.BotStopEvent;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.event.EventListener;
import org.springframework.stereotype.Component;

@Component
public class DealListener {
    private static final Logger _LOGGER = LoggerFactory.getLogger(DealListener.class);

    @EventListener
    public void listener4BotStopEvent(BotStopEvent event) {
        PersonalBotCache.PERSONALBOT_CACHE.remove(event.getSysLoginAccount());
        _LOGGER.info("收到{}登出事件", event.getSysLoginAccount());
    }

}
